using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using WorldEditSupport;

namespace WorldEdit
{
	public partial class MainForm : Form
	{
		WorldDoc _doc = new WorldDoc();
		public WorldDoc Document
		{
			get { return _doc; }
			set
			{
				editContainer.Document = value;
			}
		}


		WorldEditPresenter _presenter;
		public WorldEditPresenter Presenter
		{
			get { return _presenter; }
		}

		public MainForm()
		{
			InitializeComponent();
			_presenter = new WorldEditPresenter(this);
		}

		private void MainForm_Load(object sender, EventArgs e)
		{
			_presenter.FileNew();
		}

		private void exitToolStripMenuItem1_Click(object sender, EventArgs e)
		{
			Close();
		}

		private void openToolStripMenuItem1_Click(object sender, EventArgs e)
		{
			if (openFileDialog.ShowDialog() == DialogResult.OK)
			{
				_presenter.LoadFile(openFileDialog.FileName);
			}
		}
	}
}